package gang.com.downloader;

import android.content.Context;

import java.util.Observable;

/**
 * Created by xiaogangzai on 2017/11/4.
 * 被观察者
 */

public class DataChanger extends Observable {
    //单例模式
    private static DataChanger mInstance;

    private DataChanger() {}

    public synchronized static  DataChanger getmInstance()
    {
        if (mInstance==null)
        {
            mInstance=new DataChanger();
        }
        return mInstance;
    }
    public void postStatus(DownloadEntry entry) {
        //被观察者数据源改变
        setChanged();//被观察者系统方法
        notifyObservers(entry);
    }
}
